package cn.edu.abtu.controller.front;

import cn.edu.abtu.entity.frontvo.CourseFrontVo;
import cn.edu.abtu.service.EduCourseService;
import cn.edu.abtu.vo.ResponseData;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@CrossOrigin
@RestController
@RequestMapping("/eduservice/coursefront")
public class CourseFrontController {

    @Autowired
    private EduCourseService eduCourseService;

    @PostMapping("/getFrontCourseList/{page}/{limit}")
    public ResponseData getFrontCourseList(@PathVariable Integer page,
                                           @PathVariable Integer limit,
                                           @RequestBody(required = false) CourseFrontVo courseFrontVo){
        return eduCourseService.getFrontCourseList(page,limit,courseFrontVo);
    }

    @GetMapping("/getFrontCourseInfo/{courseId}")
    public ResponseData getFrontCourseInfo(@PathVariable String courseId){
        return eduCourseService.getFrontCourseInfo(courseId);
    }
}
